package com.banach.prema.im.config;

import com.tencentyun.TLSSigAPIv2;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TlsConfig {
	@Resource
	private AppConfig appConfig;
	private Long expire = 60 * 60 * 24 * 3650L;

	public String getUsersig(String userId) {
		TLSSigAPIv2 api = new TLSSigAPIv2(appConfig.getSdkAppId(), appConfig.getSecretKey());
		return api.genUserSig(userId, expire);
	}

}
